<?php
namespace Common\Models;
use Common\BaseModel;
class BShopAddress extends BaseModel
{
    public $res;
    public $expire;

    public function initialize()
    {
        parent::initialize();
        $this->setSource('b_shop_address');
    }


    public function get_list($user_id){
        $conditions = "user_id={$user_id}";
        $get_list = $this->find(array(
            $conditions,
            "columns"=>"id,name,phone,province,province_code,city,city_code,area,area_code,address,is_default as default",
            "order"=>"is_default desc",
        ))->toarray();
        foreach($get_list as $key=>$value){
            $get_list[$key]['address'] = $value['province'].$value['city'].$value['area'].$value['address'];

        }
        return $get_list;
    }


}
